<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/7/4
  Time: 16:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>单个游记</title>
</head>
<style type="text/css">
    .bg_header{
        width: 70%;
        height: 400px;
        margin: 0 auto;
        margin-top: 100px;
        background: #7A8B8B;
    }
    .title{
        padding-top: 250px;
        width: 710px;
        margin:0 auto;

    }
    #stb_title{
        width: 700px;
        height: 50px;
        background: #7A8B8B;
        color: white;
        font-size: 30px;
        margin-bottom: 0;
        border-width:  0 0 3px 0;
    }
    .stb_date{
        width: 700px;
        height: 50px;
    }
    .stb_date,span{
        color: white;
        font-size: 30px;
        margin: 0 auto;
        padding: 20px;
    }
    .stb_content{
        width: 900px;
        margin: 0 auto;
    }

    .stb_content_title{

        width: 900px;
        margin-top: 20px;
        height: 40px;
        text-align: center;
        line-height: 40px;
        color: green;
        border:1px solid black ;
        /*display: none;*/
    }
    .stb_content_text {
        width: 900px;
        height: 400px;
        border:1px solid black ;
        border-top: 0;
        margin: 0 auto;
        display: none;
    }
    .stb_content_text input{

        width: 700px;
        height: 40px;
        margin: 50px 100px;
    }
    .addcontent{
        width: 900px;
        margin-top: 20px;
        height: 40px;
        text-align: center;
        line-height: 40px;
        color: green;
        border:1px dashed black ;
    }

</style>
<body>
<div>
    <div class="bg_header">
        <div class="title">
            <input id="stb_title" type="text" name="title" placeholder="游记题目" value="">
            <div class="stb_date">
                <span>出发日期</span>
                <span>结束日期</span>
            </div>
        </div>

        <div class="stb_content" >
            <div class="stb_content_title" id="content1" onclick="display()">
                第1天
            </div>
            <div class="stb_content_text" id="content2">
                <input id="stb_content_text_nav"  type="text" name="" placeholder="请输入去过的酒店、餐厅、景点">
            </div>
            <div class="addcontent" id="addcontent1" onclick="show()" ><a href="javascript:void(0)" onclick="addDay()">+添加新一天</a></div>
        </div>
    </div>
</div>
<script type="text/javascript">

    function display() {
        var div2 = document.getElementById("content2");
        if(div2.style.display=="none"){
            div2.style.display="block";
        }else{
            div2.style.display = "none";
        }
    }
    function show(){
        var div1 = document.getElementById("addcontent1");
        if(div2.style.display=="block"){
            div2.style.display = "none";
        }

    }

    function addDay(){
        var divNode = document.getElementsByClassName("bg_header")[0];
        var divNode2 = document.createElement("div");


        divNode2.innerHTML = "<div class='stb_content'></div><div class='stb_content_title' id='content1' onclick='display()'>第2天</div><div class='stb_content_text' id='content2'><input id='stb_content_text_nav'  type='text'  placeholder='请输入去过的酒店、餐厅、景点'></div><div class='addcontent' id='addcontent1'  ><a href='javascript:;' onclick='addDay()'>+添加新一天</a></div></div>";

        divNode.appendChild(divNode2);
    }

</script>
</body>
</html>
